From: Claudio Cambra Date: Tue, 18 Feb 2025 07:44:55 +0000 (+0800) Subject: gui/wizard: Display macOS-specific VFS information where relevant in advanced setup... X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~1^2~18^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=04cc4246102c082a78a8ac5526d9509bab71d0ea;p=nextcloud-desktop.git gui/wizard: Display macOS-specific VFS information where relevant in advanced setup page Signed-off-by: Claudio Cambra --- diff --git a/src/gui/wizard/owncloudadvancedsetuppage.cpp b/src/gui/wizard/owncloudadvancedsetuppage.cpp index ed4dac9ff..d4217620d 100644 --- a/src/gui/wizard/owncloudadvancedsetuppage.cpp +++ b/src/gui/wizard/owncloudadvancedsetuppage.cpp @@ -83,11 +83,14 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage(OwncloudWizard *wizard) connect(_ui.rSyncEverything, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSyncEverythingClicked); connect(_ui.rSelectiveSync, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked); connect(_ui.rVirtualFileSync, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotVirtualFileSyncClicked); - connect(_ui.rVirtualFileSync, &QRadioButton::toggled, this, [this](bool checked) { + connect(_ui.rVirtualFileSync, &QRadioButton::toggled, this, [this](const bool checked) { if (checked) { _ui.lSelectiveSyncSizeLabel->clear(); _selectiveSyncBlacklist.clear(); } +#ifdef BUILD_FILE_PROVIDER_MODULE + updateMacOsFileProviderRelatedViews(); +#endif }); connect(_ui.bSelectiveSync, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked); @@ -328,10 +331,14 @@ void OwncloudAdvancedSetupPage::updateStatus() setResolutionGuiVisible(false); } +#ifdef BUILD_FILE_PROVIDER_MODULE + updateMacOsFileProviderRelatedViews(); +#else _filePathLabel->setText(QDir::toNativeSeparators(locFolder)); QString lfreeSpaceStr = Utility::octetsToString(availableLocalSpace()); _ui.lFreeSpace->setText(QString(tr("%1 free space", "%1 gets replaced with the size and a matching unit. Example: 3 MB or 5 GB")).arg(lfreeSpaceStr)); +#endif _ui.syncModeLabel->setText(t); _ui.syncModeLabel->setFixedHeight(_ui.syncModeLabel->sizeHint().height()); @@ -636,6 +643,28 @@ void OwncloudAdvancedSetupPage::setRadioChecked(QRadioButton *radio) _ui.rVirtualFileSync->setCheckable(false); } +#ifdef BUILD_FILE_PROVIDER_MODULE +void OwncloudAdvancedSetupPage::updateMacOsFileProviderRelatedViews() +{ + if (!Mac::FileProvider::fileProviderAvailable()) { + return; + } + + const auto freeSpaceHidden = _ui.rVirtualFileSync->isChecked(); + const auto folderSelectionButtonHidden = _ui.rVirtualFileSync->isChecked(); + const auto filePathLabelText = + _ui.rVirtualFileSync->isChecked() ? tr("In Finder's \"Locations\" sidebar section") : QDir::toNativeSeparators(localFolder()); + const auto freeSpaceString = freeSpaceHidden ? QString() : Utility::octetsToString(availableLocalSpace()); + const auto freeSpaceText = freeSpaceHidden ? QString() : QString(tr("%1 free space", "%1 gets replaced with the size and a matching unit. Example: 3 MB or 5 GB")).arg(freeSpaceString); + + _ui.lFreeSpace->setHidden(freeSpaceHidden); + _ui.lFreeSpace->setText(freeSpaceText); + _ui.pbSelectLocalFolder->setHidden(folderSelectionButtonHidden); + _ui.pbSelectLocalFolder->setEnabled(!folderSelectionButtonHidden); + _filePathLabel->setText(filePathLabelText); +} +#endif + void OwncloudAdvancedSetupPage::styleSyncLogo() { const auto syncArrowIcon = Theme::createColorAwareIcon(QLatin1String(":/client/theme/sync-arrow.svg"), palette()); diff --git a/src/gui/wizard/owncloudadvancedsetuppage.h b/src/gui/wizard/owncloudadvancedsetuppage.h index d01ebe4d9..9192b7c9d 100644 --- a/src/gui/wizard/owncloudadvancedsetuppage.h +++ b/src/gui/wizard/owncloudadvancedsetuppage.h @@ -69,6 +69,10 @@ private slots: private: void setRadioChecked(QRadioButton *radio); +#ifdef BUILD_FILE_PROVIDER_MODULE + void updateMacOsFileProviderRelatedViews(); +#endif + void setupCustomization(); void updateStatus(); bool dataChanged();